package classes.view.component
{
	import flash.display.Sprite;
	
	
	public class Notice extends Sprite
	{
		private var _defaultNotice:DefaultNotice;
		private var _gameNotice:GameNotice;
		private var _singlegameNotice:SinglegameNotice;
		
		private var _currentNotice:int;  // 0 : default, 1 : singleroom, 2: gameroom
		public function Notice()
		{
			super();
			setLayOut();
			
		}
		
		
		public function set notice_on($noticeType:int):void
		{
			removeNotice();
			_currentNotice = $noticeType;
			
			switch($noticeType){
				case 0:
					trace('notice_defaultNotice');
					this._defaultNotice.notice_switch 		= true;
					
					break;
				case 1:
					trace('notice_singleroom');
					this._singlegameNotice.notice_switch 	= true;
					
					break;
				case 2:
					trace('notice_gameroom');
					this._gameNotice.notice_switch 			= true;
					
					break;
			}
		}
		
		private function removeNotice():void
		{
			switch(_currentNotice){
				case 0:
					//defaultNotice.
					this._defaultNotice.notice_switch 		= false;
					break;
				case 1:
					this._singlegameNotice.notice_switch 	= false;
					break;
				case 2:
					this._gameNotice.notice_switch 			= false;
					break;
			}
		}
		
		
		private function setLayOut():void
		{
			this._defaultNotice 	= this.getChildByName('defaultNotice_mc') 		as DefaultNotice;
			this._gameNotice		= this.getChildByName('gameNotice_mc') 			as GameNotice;
			this._singlegameNotice  = this.getChildByName('singlegameNotice_mc')	as SinglegameNotice;
		}
		
	}
}